package com.franklin.ideaplugin.api.beans.declaration.impl;

import com.franklin.ideaplugin.api.beans.declaration.IDeclaration;
import com.franklin.ideaplugin.api.beans.variable.IVariable;
import com.franklin.ideaplugin.api.beans.variable.impl.FieldVariable;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiField;
import com.intellij.psi.PsiType;
import org.jetbrains.annotations.NotNull;

/**
 * @author Ye Junhui
 * @since 2024/3/6
 */
public class FieldDeclaration implements IDeclaration {

    private PsiField psiField;

    public FieldDeclaration(PsiField psiField) {
        this.psiField = psiField;
    }

    @Override
    public IVariable getVariable() {
        return new FieldVariable(psiField);
    }

    @Override
    public @NotNull PsiElement getPsiElement() {
        return this.psiField;
    }

    @Override
    public PsiType getPsiType() {
        return getVariable().getPsiType();
    }
}
